package com.dolphin.common.expr.emus;

import lombok.Getter;

/**
 * @author shida
 */

@Getter
public enum CalculateTypeEnum {

    NORMAL_STAT(0, "普通统计"),
    EVERY_CUMULATIVE(1, "每累计");

    private int code;
    private String desc;

    CalculateTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CalculateTypeEnum getByCode(int code) {
        for (CalculateTypeEnum calculateTypeEnum : CalculateTypeEnum.values()) {
            if (calculateTypeEnum.getCode() == code) {
                return calculateTypeEnum;
            }
        }
        return null;
    }
}
